using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_OptionGroup_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.OptionGroup);
            args = new Type[]{typeof(huqiang.UIEvent.UserEvent)};
            method = type.GetMethod("AddEvent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AddEvent_0);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement)};
            method = type.GetMethod("AddChildEvent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AddChildEvent_1);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement)};
            method = type.GetMethod("AddEvent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, AddEvent_2);
            args = new Type[]{};
            method = type.GetMethod("get_LastSelect", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_LastSelect_3);
            args = new Type[]{typeof(huqiang.UIEvent.UserEvent)};
            method = type.GetMethod("set_LastSelect", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_LastSelect_4);
            args = new Type[]{};
            method = type.GetMethod("get_Select", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Select_5);
            args = new Type[]{typeof(huqiang.UIEvent.UserEvent)};
            method = type.GetMethod("set_Select", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_Select_6);
            args = new Type[]{};
            method = type.GetMethod("ReSet", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, ReSet_7);
            args = new Type[]{};
            method = type.GetMethod("Clear", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Clear_8);

            field = type.GetField("options", flag);
            app.RegisterCLRFieldGetter(field, get_options_0);
            app.RegisterCLRFieldSetter(field, set_options_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_options_0, AssignFromStack_options_0);
            field = type.GetField("MultiSelect", flag);
            app.RegisterCLRFieldGetter(field, get_MultiSelect_1);
            app.RegisterCLRFieldSetter(field, set_MultiSelect_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_MultiSelect_1, AssignFromStack_MultiSelect_1);
            field = type.GetField("SelectChanged", flag);
            app.RegisterCLRFieldGetter(field, get_SelectChanged_2);
            app.RegisterCLRFieldSetter(field, set_SelectChanged_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_SelectChanged_2, AssignFromStack_SelectChanged_2);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.OptionGroup());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.OptionGroup[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* AddEvent_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIEvent.UserEvent @user = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AddEvent(@user);

            return __ret;
        }

        static StackObject* AddChildEvent_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIElement @ui = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AddChildEvent(@ui);

            return __ret;
        }

        static StackObject* AddEvent_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIElement @element = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AddEvent(@element);

            return __ret;
        }

        static StackObject* get_LastSelect_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.LastSelect;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_LastSelect_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIEvent.UserEvent @value = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.LastSelect = value;

            return __ret;
        }

        static StackObject* get_Select_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Select;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_Select_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIEvent.UserEvent @value = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Select = value;

            return __ret;
        }

        static StackObject* ReSet_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.ReSet();

            return __ret;
        }

        static StackObject* Clear_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.OptionGroup instance_of_this_method = (huqiang.UIComposite.OptionGroup)typeof(huqiang.UIComposite.OptionGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Clear();

            return __ret;
        }


        static object get_options_0(ref object o)
        {
            return ((huqiang.UIComposite.OptionGroup)o).options;
        }

        static StackObject* CopyToStack_options_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.OptionGroup)o).options;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_options_0(ref object o, object v)
        {
            ((huqiang.UIComposite.OptionGroup)o).options = (huqiang.UIComposite.OptionsType)v;
        }

        static StackObject* AssignFromStack_options_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.OptionsType @options = (huqiang.UIComposite.OptionsType)typeof(huqiang.UIComposite.OptionsType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            ((huqiang.UIComposite.OptionGroup)o).options = @options;
            return ptr_of_this_method;
        }

        static object get_MultiSelect_1(ref object o)
        {
            return ((huqiang.UIComposite.OptionGroup)o).MultiSelect;
        }

        static StackObject* CopyToStack_MultiSelect_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.OptionGroup)o).MultiSelect;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_MultiSelect_1(ref object o, object v)
        {
            ((huqiang.UIComposite.OptionGroup)o).MultiSelect = (System.Collections.Generic.List<huqiang.UIEvent.UserEvent>)v;
        }

        static StackObject* AssignFromStack_MultiSelect_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Collections.Generic.List<huqiang.UIEvent.UserEvent> @MultiSelect = (System.Collections.Generic.List<huqiang.UIEvent.UserEvent>)typeof(System.Collections.Generic.List<huqiang.UIEvent.UserEvent>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.OptionGroup)o).MultiSelect = @MultiSelect;
            return ptr_of_this_method;
        }

        static object get_SelectChanged_2(ref object o)
        {
            return ((huqiang.UIComposite.OptionGroup)o).SelectChanged;
        }

        static StackObject* CopyToStack_SelectChanged_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.OptionGroup)o).SelectChanged;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_SelectChanged_2(ref object o, object v)
        {
            ((huqiang.UIComposite.OptionGroup)o).SelectChanged = (System.Action<huqiang.UIComposite.OptionGroup, huqiang.UIEvent.UserAction>)v;
        }

        static StackObject* AssignFromStack_SelectChanged_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.UIComposite.OptionGroup, huqiang.UIEvent.UserAction> @SelectChanged = (System.Action<huqiang.UIComposite.OptionGroup, huqiang.UIEvent.UserAction>)typeof(System.Action<huqiang.UIComposite.OptionGroup, huqiang.UIEvent.UserAction>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.OptionGroup)o).SelectChanged = @SelectChanged;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.OptionGroup();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
